package com.qzsoft.zhjd.machine.modules.machineinfo.entity;

import java.util.Date;

import javax.validation.constraints.NotBlank;

import org.hibernate.validator.constraints.Length;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.qzsoft.jeemis.common.validator.group.AddGroup;
import com.qzsoft.jeemis.common.validator.group.UpdateGroup;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * @ClassName MachineInfoDriverEntity
 * @Description 机械设备操作员
 * @author linhuawei
 * @since 2021-11-01
 */
@Data
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ToString
@TableName("machine_info_driver")
public class MachineInfoDriverEntity {

    /**
     * 主键
     */
    @NotBlank(groups = UpdateGroup.class, message = "标识不可为空")
    @TableId(type = IdType.ASSIGN_UUID)
    private String id;
    
    /**
     * 机械主键
     */
    @NotBlank(groups = {UpdateGroup.class, AddGroup.class}, message = "机械设备不可为空")
    @TableField(updateStrategy = FieldStrategy.NEVER)
    private String machineId;
    
    /**
     * 驾驶员主键
     */
    @NotBlank(groups = {UpdateGroup.class, AddGroup.class}, message = "驾驶员不可为空")
    @TableField(updateStrategy = FieldStrategy.NEVER)
    private String driverId;
    
    /**
     * 备注
     */
    @Length(groups = {UpdateGroup.class, AddGroup.class}, max = 200, message = "备注信息不可超过{max}个字")
    private String info;


    /**
     * 创建者
     */
    @TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NEVER)
    private Long creator;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE, updateStrategy = FieldStrategy.NEVER)
    private Date createDate;
}
